import sys
from PyQt4.Qt import *
import panal_ui
import Ventana1_ui
import Ventana2_ui
import Ventana3_ui
import Ventana4_ui
import Ventana5_ui

class Ventana1(QWidget, Ventana1_ui.Ui_Form):
	def __init__(self, parent=None):
			super(Ventana1, self).__init__(parent)
			self.setupUi(self)

class Ventana2(QWidget, Ventana2_ui.Ui_Form):
	def __init__(self, parent=None):
			super(Ventana2, self).__init__(parent)
			self.setupUi(self)

class Ventana3(QWidget, Ventana3_ui.Ui_Form):
	def __init__(self, parent=None):
			super(Ventana3, self).__init__(parent)
			self.setupUi(self)

class Ventana4(QWidget, Ventana4_ui.Ui_Form):
	def __init__(self, parent=None):
			super(Ventana4, self).__init__(parent)
			self.setupUi(self)

class Ventana5(QWidget, Ventana5_ui.Ui_Form):
	def __init__(self, parent=None):
			super(Ventana5, self).__init__(parent)
			self.setupUi(self)

class MainWindow(QMainWindow, panal_ui.Ui_MainWindow):

	def __init__(self, parent=None):
		super(MainWindow, self).__init__(parent)
		self.setupUi(self)
		self.connectActions()
 
	def connectActions(self):
		self.connect(self.pushButton, SIGNAL('clicked()'), self.Accion1)
		self.connect(self.pushButton_2, SIGNAL('clicked()'), self.Accion2)
		self.connect(self.pushButton_3, SIGNAL('clicked()'), self.Accion3)
		self.connect(self.pushButton_4, SIGNAL('clicked()'), self.Accion4)
		self.connect(self.pushButton_5, SIGNAL('clicked()'), self.Accion5)
		
	def Accion1(self):
		self.w = Ventana1()
		self.w.show()
			
	def Accion2(self):
		self.w = Ventana2()
		self.w.show()

	def Accion3(self):
		self.w = Ventana3()
		self.w.show()

	def Accion4(self):
		self.w = Ventana4()
		self.w.show()

	def Accion5(self):
		self.w = Ventana5()
		self.w.show()

		
class App(QApplication):
    def __init__(self, *args):
        QApplication.__init__(self, *args)
        self.main = MainWindow()
        self.connect(self, SIGNAL("lastWindowClosed()"), self.byebye )
        self.main.show()

    def byebye( self ):
        self.exit(0)

def main(args):
    global app
    app = App(args)
    app.exec_()

if __name__ == "__main__":
    main(sys.argv)
	
	